#pragma once
#ifndef GAME_H

#define GAME_H
#include <iostream>
#include <vector>
#include <SDL.h>
#include <SDL_ttf.h>
#include "TextureManager.h"
#include "GameObject.h"
#include "GameStateMachine.h"

class Game
{
public:
	
	static Game* Instance()
	{
		if(mInstance == NULL)
			mInstance = new Game();
		return mInstance;
	}
	bool Initialize(const char* title, int xpos, int ypos, int width, int height, bool fullscreen);
	void Render();
	void Update();
	void EventHandler();
	void Shutdown();

	bool Running(){ return mRunning; }
	SDL_Renderer* getRenderer() const { return mRenderer;}
	GameStateMachine* getGameStateMachine() { return mGameStateMachine;}

private:
	Game() {};
	~Game() {};
	void LoadStart();

	SDL_Window* mWin;
	SDL_Renderer* mRenderer;
	TTF_Font* mFont;

	GameStateMachine* mGameStateMachine;

	int currentFrame;

	bool mRunning;
	static Game* mInstance;
	std::vector<GameObject*> mGameObjects;
};

#endif

